﻿@{ ViewBag.Title = "OrderManagement";}
<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0" height="0"><embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0" pluginspage="install_lodop32.exe"></embed></object>
<script src="~/Scripts/jquery.hiMallDatagrid.js"></script>
<script src="~/Scripts/jquery.himallLinkage.nocreate.js"></script>
<script src="~/Scripts/jquery.placeholder.min.js"></script>
<script src="~/Scripts/bootstrap.autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="~/Content/bootstrap-datetimepicker.min.css">
<script type="text/javascript" src="~/Scripts/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" src="~/Scripts/bootstrap-datetimepicker.zh-CN.js"></script>

<script src="~/Scripts/LodopFuncs.js"></script>
<script src="~/Areas/SellerAdmin/Scripts/orderManagement.js"></script>
<script type="text/javascript">
    $(function () {
        $(".start_datetime").datetimepicker({
            language: 'zh-CN',
            format: 'yyyy-mm-dd',
            autoclose: true,
            weekStart: 1,
            minView: 2
        });
        $(".end_datetime").datetimepicker({
            language: 'zh-CN',
            format: 'yyyy-mm-dd',
            autoclose: true,
            weekStart: 1,
            minView: 2
        });
        $(".start_datetime").click(function () {
            $('.end_datetime').datetimepicker('show');
        });
        $(".end_datetime").click(function () {
            $('.start_datetime').datetimepicker('show');
        });
        $('.start_datetime').on('changeDate', function () {
            if ($(".end_datetime").val()) {
                if ($(".start_datetime").val() > $(".end_datetime").val()) {
                    $('.end_datetime').val($(".start_datetime").val());
                }
            }

            $('.end_datetime').datetimepicker('setStartDate', $(".start_datetime").val());
        });


    });
</script>
<style type="text/css">
    i.refundico { display: inline-block; width: 16px; overflow: hidden; height: 17px; background: url("/Images/iconfont-tui.png") no-repeat center center; text-indent: -999px; margin-right: 3px; }
</style>

<div class="container">
    <ul class="nav nav-tabs-custom clearfix">
        <strong>订单</strong>
        <li value="0" type="statusTab"><a>所有订单</a></li>
        <li value="1" type="statusTab"><a>待付款</a></li>
        <li value="2" type="statusTab"><a>待发货</a></li>
        <li value="3" type="statusTab"><a>待收货</a></li>
        <li value="5" type="statusTab"><a>交易完成</a></li>
        <li value="4" type="statusTab"><a>已关闭</a></li>
        <em class="primary-btn">
            <span class="glyphicon glyphicon-question-sign"></span>
            <div class="primary">
                <h3>温馨提示：</h3>
                <span>*</span><p>管理店铺所有的订单，可以取消或关闭订单</p>
            </div>
        </em>

    </ul>

    <div class="search-box" id="search-box">
        <form class="custom-inline" role="form">
            <div class="form-group">
                <label class="label-inline" for="">开始日期</label>
                <input id="inputStartDate" class="form-control input-ssm start_datetime" type="text">
            </div>
            <div class="form-group">
                <label class="label-inline" for="">结束日期</label>
                <input id="inputEndDate" class="form-control input-ssm end_datetime" type="text">
            </div>
            <div class="form-group">
                <label class="label-inline" for="">订单号</label>
                <input class="form-control input-ssm" type="text" id="txtOrderId">
            </div>
            <div class="form-group">
                <label class="label-inline" for="">买家</label>
                <input class="form-control input-ssm" type="text" id="txtUserName">
            </div>
            <div class="form-group">
                <label class="label-inline" for="">订单类型</label>
                <select id="orderType" class="form-control input-ssm">
                    <option value="">全部类型</option>
                                        @foreach (var item in Enum.GetValues(typeof(Himall.Core.PlatformType)))
                    {
                        switch ((Himall.Core.PlatformType)item)
                        {

                            case Himall.Core.PlatformType.Android:
                            case Himall.Core.PlatformType.Mobile:
                                break;
                            case Himall.Core.PlatformType.IOS:
                                <option value="@((int)item)">APP(IOS)订单</option>
                                break;
                            default:
                                <option value="@((int)item)">@(((Himall.Core.PlatformType)item).ToDescription())订单</option>
                                break;

                        }
                    }
                </select>
            </div>
            <div class="submit"><button type="button" class="btn btn-primary btn-sm" id="searchButton">搜 索</button></div>
        </form>
    </div>

    <table id="list" class="table"></table>

    <div class="tabel-operate" id="orderOperate">
        <a onclick="downloadOrderList()" href="#" class="btn btn-default btn-ssm">订单配货表</a>
        <a onclick="myPreview()" class="btn btn-default btn-ssm">打印发货单</a>
        <a onclick="printOrders()" class="btn btn-default btn-ssm">打印快递单</a>
        <a onclick="sendGood()" class="btn btn-default btn-ssm">批量发货</a>
    </div>
</div>
<script>
    $(function () {
        var val = "@Request.QueryString["status"]";
        $('.nav li').each(function () {
            if ($(this).val() == val) {
                $(this).addClass('active').siblings().removeClass('active');
            }
        });
    });
</script>
